package com.javase.homework.module2;

//（2）通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息
public class CallPackage extends Package implements CallService{

    private double callTime;
    private int textNum;


    public CallPackage(double monthCost, double callTime, int textNum) {
        super(monthCost);
        this.callTime = callTime;
        this.textNum = textNum;
    }


    public CallPackage() {
    }

    public double getCallTime() {
        return callTime;
    }

    public void setCallTime(double callTime) {
        this.callTime = callTime;
    }

    public int getTextNum() {
        return textNum;
    }

    public void setTextNum(int textNum) {
        this.textNum = textNum;
    }



    @Override
    public void show() {

        System.out.println("通话时长为" + callTime + "," + "短信条数为" + textNum + "," + "每月资费为" + getMonthCost() + "元。");
    }

    //    （1）通话服务接口 抽象方法: 参数1: 通话分钟, 参数2: 手机卡类对象 让通话套餐类实现通话服务接口。
    @Override
    public void call(double callTime, String cardType) {
        System.out.println("通话分钟为" + callTime + "分钟，" + "手机卡类型为" + cardType);
    }
}
